package com.okwanshiwu.constant;

import com.okwanshiwu.util.PropUtil;
import org.apache.log4j.Logger;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/**
 * *********************************************************************************************
 * 版权所有 (C)2016, 北京顺圆科技
 * <p>
 * 文件名称：App相关常量
 * 当前版本：1.0.0
 * 作    者： masteryuan
 * 完成日期：2017.07.24
 ***********************************************************************************************
 */
public class AppConstants {

	private Logger logger = Logger.getLogger(AppConstants.class);

	private static final Map<String,String> commonProperties = new HashMap<String,String>();
	//加载common.properties配置文件
	static {
		reloadProp("common.properties");
	}

	public static String getValue(String key){
		return commonProperties.get(key);
	}

	public static void reloadProp(String filePath){
		Properties prop = PropUtil.loadProps(filePath);
		if(prop != null){
			Set<Object> set = prop.keySet();
			for(Object key : set){
				String value = prop.getProperty(key.toString());
				commonProperties.put(key.toString(),value);
			}
		}
	}



	public static Map getCommonProperties(){
		return commonProperties;
	}

	public static final String NO_INTERCEPTOR_PATH = ".*/((noauth)|(logout)).*";

	public static final int APP_LOGIN = 1;  //登陆

	public static final int APP_REGISTER = 2;  //注册
	public static final int APP_SEND_MOBILE_CODE = 3; //发送手机验证码
	public static final int APP_FIND_PASSWORD = 4; //找回密码
	public static final int APP_BIND_ALIPAY = 5; //绑定支付宝
	public static final int APP_FILL_USER_INFO = 6; //完善用户资料
	public static final int APP_GETUSER_INFO = 7; //查询用户信息
	public static final int APP_USER_PHOTO_SORT = 11; //用户图片排序
	public static final int APP_GET_USER_GRALLERY = 12; //获取用户相册
	public static final int APP_UPDATE_SERVICE = 13; //更新服务内容
	public static final int APP_DELETE_GALLERY_PHOTO = 14; //删除相册图片
	public static final int APP_GET_GALLERY_PHOTO = 15; //获取用户相册图片
	public static final int APP_GET_USER_SERVICE = 16; //获取用户发布的服务
	public static final int APP_SAVE_USER = 17; //收藏用户
	public static final int APP_CANCEL_SAVE_USER = 18; //取消收藏
	public static final int APP_GET_SAVE_LIST = 19; //获取用户收藏列表
	public static final int APP_DELETE_PUB_SERVICE = 20; //删除单条服务
	public static final int APP_DELETE_ALL_SERVICE = 21; //删除所有服务
	public static final int APP_GET_ALL_TAGS = 22; //获取所有标签
	public static final int APP_GET_ALL_HOBBY = 23; //获取所有兴趣爱好标签
	public static final int APP_GET_SERVICE_INFO = 24; //获取服务详情
	public static final int APP_GET_USER_SAVE_LIST = 25; //获取收藏该用户的所有用户信息
	public static final int APP_GET_USER_SAVE_COUNT = 26; //获取用户被收藏数量
	public static final int APP_CREATE_ORDER = 27; //创建订单
	public static final int APP_GET_WAIT_AGREE_ORDER = 28; //获取待确认订单列表
	public static final int APP_GET_ORDER_INFO = 29; //获取订单
	public static final int APP_COMMENT_ORDER = 30; //评论订单
	public static final int APP_GET_COMMENT_LIST = 31; //获取评论列表根据服务id
	public static final int APP_GET_SKETCH_LIST = 33; //获取所有稿子, 按照评论+分享次数排序
	public static final int APP_COMMENT_SKETCH = 34; //评论稿子
	public static final int APP_GETCOMMENT_BY_SKETCHID = 35; //获取评论列表通过稿子id
	public static final int APP_GETINDEXSRV = 36; //获取首页服务
	public static final int APP_UPDATE_ORDER_STATE = 37; //更新订单状态
	public static final int APP_CHECK_SAVE = 38; //判断用户是否收藏
	public static final int APP_GET_COMMENT_LIST_BYUID = 39; //获取用户的所有服务评论
	public static final int APP_DEL_ORDER = 40; //删除订单
	public static final int APP_UPDATE_USER_GPRS = 41; //更新用户当前位置
	public static final int APP_REGISTER_DEV = 42; //设备注册
	public static final int APP_UPDATE_REGISTER_DEV = 43; //更新设备
	public static final int APP_FIND_USER_BYNID = 44; //根据数字id查找用户
	public static final int APP_UPDATE_VERSION = 45; //更新当前版本
	public static final int APP_GET_CURRENT_VERSION = 46; //获取当前最新版本号
	public static final int APP_GET_USER_INFO_BYNID = 47; //获取用户信息通过nid
	public static final int APP_GET_SERVICE_TAG_LIST = 48; //获取服务
	public static final int APP_GET_USER_TIP = 49; //获取用户动态提醒
	public static final int APP_GET_PROFESSION_LIST = 50; //获取工作职位列表
	public static final int APP_DEL_USER_BY_UID = 51; //删除用户通过用户id和密码,仅仅能删除自己
	public static final int APP_UPDATE_USER_TIP = 52; //更新用户tip
	public static final int APP_PAY_VERIFY_ALIPAY = 53; //校验支付宝支付结果
	public static final int APP_PAY_VERIFY_WXPAY = 54; //校验微信支付结果
	public static final int APP_SELL_AGREE = 55; //卖家接单
	public static final int APP_SERVER_END = 56; //服务完毕同意打款
	public static final int APP_REFUND = 57; //申请退款
	public static final int APP_SELL_NO_AGREE = 58; //卖家拒绝接单
	public static final int APP_SELL_ALL_ORDER = 59;  //已售所有订单
	public static final int APP_BUY_ALL_ORDER = 60; //已购所有订单
	public static final int APP_INFORM = 61; //举报
	public static final int APP_GET_BIND_LIST = 62; //获取用户绑定的银行卡
	public static final int APP_WITHDRAW = 63; //提现
	public static final int APP_UNBIND_BANK_CARD = 64; //解绑银行卡
	public static final int APP_ADD_SHARE_REWARD = 65; //添加分享奖励
	public static final int APP_RE_SRV = 66; //推荐列表
	public static final int APP_INTRO_LIST = 67; //欢迎页列表
	public static final int APP_GET_COMMENT_NEW = 68;//no use
	public static final int APP_LIKEK = 69;
	public static final int APP_GET_SCKETCH_BYIDS = 70; //批量获取话题通过话题ID
	public static final int APP_INDEX_SORT_1 = 71; //按照70KM为条件排序获取首页数据接口
	public static final int APP_INVITE_FRIEND = 72; //发送短信，邀请朋友试玩天天租我
	public static final int APP_CANCEL_ORDER = 84;//正价  在卖家没接单前取消订单
	public static final int APP_GET_WX = 85;//获取用户微信号
	public static final int APP_BUY_WX = 86;//查看已购买过的微信用户
	public static final int APP_GET_WXINCOME = 87;//获取微信号和微信收益
	public static final int APP_PAY_WX = 88;//使用钱包支付付款
	public static final int APP_ACTIVITY = 89;//活动接口---目前就是生成鼓励金额
	public static final int APP_ORDER = 73; //获取预支付订单（前台生成订单号，调用此接口，将订单号保存到tb_service中去）
	public static final int APP_ALIPAY_ORDER = 74; //获取支付宝签名后的订单信息(暂未使用，由前台直接签名了)
	public static final int APP_INVERT_CREATE_ORDER = 75;   //对倒贴服务下单
	public static final int APP_INVERT_SELL_AGREE = 76;     //倒贴服务者接单
	public static final int APP_INVERT_SELL_NO_AGREE = 77;  //倒贴服务者拒单
	public static final int APP_INVERT_SELL_AGREE_PAY = 78; //倒贴服务者同意付款
	public static final int APP_INVERT_REFUND = 79;         //倒贴服务者申请退款
	public static final int APP_INVERT_CHECKEXIST_SRV = 80;   //检查是否已有倒贴服务，如果已有，则发布新服务前要告知
	public static final int APP_INVERT_CHECKEXIST_AGREE = 81; //删除倒贴服务前，检查是否有已同意但未最后支付的订单
	public static final int APP_INVERT_CANCEL_ORDER = 82;     //倒贴者还未决定前，买家取消订单
	public static final int APP_REPEAT_ORDER = 83;     //重新发布前一个倒贴服务
	public static final int APP_SELECTED_SRV = 90;//首页瀑布流信息
	public static final int APP_GET_NAME_TYPE = 91; //获取所有兴趣爱好标签
	public static final int APP_ADD_SCAN_TYPE = 92; //记录浏览记录
	public static final int APP_GET_SCAN_TYPE = 93; //获取浏览记录
	
}
